#include "stdafx.h"
#include "ckEnumCheckModel.h"
#include "ckCheckModel.h"

namespace ck
{
	EnumCheckModel::EnumCheckModel()
	{
	}


	EnumCheckModel::~EnumCheckModel()
	{
		Cleanup();
	}

	void EnumCheckModel::Add(CheckModel* pElement)
	{
		if (pElement)
		{
			m_models.push_back(pElement);
		}
	}

	void EnumCheckModel::Cleanup()
	{
		std::vector<CheckModel*>::iterator iter;
		for (iter = m_models.begin(); iter != m_models.end(); iter++)
		{
			(*iter)->Release();
		}
		m_models.clear();
	}

	void EnumCheckModel::Reset()
	{
		m_iter = m_models.begin();
	}

	CheckModel* EnumCheckModel::Next()
	{
		if (m_iter == m_models.end())
		{
			return NULL;
		}
		return *(m_iter++);
	}

}

